<include file="Public/head" />
<style>
    #fail_type {
        -moz-appearance: none;
        background: rgba(0, 0, 0, 0) url("http://img1.isou365.cn/paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 5px;
        border: 1px solid #d7d7d7;color: #666;float: left; height: 25px;line-height: 25px;margin-left: 24px;margin-right: 10px;text-align: center;width: 150px;}
    #searchFrom .sheng-text{height:26px;width:100px;background:url("http://img3.isou365.cn/paimai/yunying/images/sanjiao.jpg") no-repeat scroll 80px 7px;border:solid 1px #c5c5c5;margin-right:7px;}
    #searchFrom .area{margin:0;}
    #searchFrom #area{width:140px; background-position:120px 7px}
    .paidan h3 {  color: #000;  font-size: 16px;  margin-bottom: 20px;}
    .shenhei-btn{margin-top: 40px;}
</style>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cwgl.ddsk"/>
    <div class="mianR">
        <div class="yuyue">
            <ul>
                <li onclick="get_list(1);" class="yuCurrent">待收款</li>
                <li onclick="get_list(2);">待核实</li>
                <li onclick="get_list(3);">收款成功</li>
            </ul>
        </div>
        <div class="yuList" >
            <div class="yuSuo clearfix">
              <input id="t" name="t" type="hidden" value="">
                <select name="location_area" id="location_area" class="tracking_list1">
                    <if condition="count($bc_city) gt 1">
                        <option value="0">请选择所在地</option>
                    </if>
                    <volist name="bc_city" id="city">
                        <option value="{$key}">{$city}</option>
                    </volist>
                </select>
                <input type="text" id="car_no" name="car_no" placeholder="车辆编号" value="{$params.order_no}" class="suoDian" style="margin: 0 2px 0 10px;"/>
                <input type="text" id="keywords" name="keywords" value="{$params.keywords}"  placeholder="车商联系人/联系人电话/拍卖单号"  class="suoDian suoDian1">
                <!--<input type="text" id="order_num" name="order_num" placeholder="拍单号" value="{$params.order_no}" class="suoDian" />-->
                <!--<input type="text" id="contact_person" name="contact_person" placeholder="车商联系人" value="" class="suoDian" />-->
                <!--<input type="text" id="contact_mobile" name="contact_mobile" placeholder="车商电话" value="" class="suoDian" />-->
                <!--<div id="search1">-->
                    <select name="pay_mode" id="pay_mode" class="tracking_list1" style="margin-left: 10px;height: 25px;line-height: 25px;">
                        <option value="">全部付款类型</option>
                        <option value="1">全款</option>
                        <option value="2">贷款</option>
                    </select>
                <!--</div>-->
                <!--<div id="search2">-->
                    <!--<select name="loan_status" id="loan_status" class="tracking_list1" style="margin-left: 10px;height: 25px;line-height: 25px;">-->
                        <!--<option value="">全部收款状态</option>-->
                        <!--<option value="1">全款待收款</option>-->
                        <!--<option value="2">首付待收款</option>-->
                        <!--<option value="3">无首付贷款待放款</option>-->
                        <!--<option value="4">有首付贷款待放款</option>-->
                    <!--</select>-->
                <!--</div>-->
                <input type="button" onclick="search();" id="search" value="搜索" class="suoSou">
                <input type="button" onclick="window.location.href='/Finance/collection'" value="全部" class="suoSou">
            </div>
            <div class="yunBei" style="display:none"></div>
            <div class="listBox" id="listBox"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
</body>
<script type="text/javascript">
    get_list(1);
    function get_list(t) {
        change_tabs(t);
        var url = get_url();
        $("#t").val(t);
        $.get("/Finance/collection_list?t="+t, url, function (data) {
            $("#listBox").html(data);
        }, "html");
    }

    function get_page(p) {
        var t = $("#t").val();
        var url = get_url();
            url += "&p=" + p;
        $.get("/Finance/collection_list?t="+t, encodeURI(url), function (data) {
            $("#listBox").html(data);
        }, "html");
    }

    function search() {
        var t = $("#t").val();
        get_list(t);
    }

    function get_url(){
        var url = "";
        var location_area = $("#location_area").val();
        var car_no = $("#car_no").val();
        var keywords = $("#keywords").val();
        var pay_mode = $("#pay_mode").val();
        var loan_status = $("#loan_status").val();
        if (location_area) {
            url += '&location_area=' + location_area;
        }
        if (car_no) {
            url += '&car_no=' + car_no;
        }
        if (keywords) {
            url += '&keywords=' + keywords;
        }
        if (pay_mode) {
            url += '&pay_mode=' + pay_mode;
        }
        if (loan_status) {
            url += '&loan_status=' + loan_status;
        }
        return url;
    }
    function change_tabs(status){
        if($("#t").val() != status){
            clear_form_params();
        }
    }

//    function change_search(st){
//        var s1=$("#search1"),s2=$("#search2");
//        if(st == 0){
//            clear_form_params();
//            s1.hide();
//            s2.show();
//        }
//        if(st == 1){
//            clear_form_params();
//            s1.show();
//            s2.show();
//        }
//        if(st == 2){
//            clear_form_params();
//            s1.show();
//            s2.hide();
//        }
//    }

    function clear_form_params(){
        $(':input').not(':button, :submit, :reset, :hidden').val('');
        if($("#location_area option").length > 1){
            $("#location_area").val(0);
        }
    }
    //业务核实
    function business_verify(order_id) {
        text = '<div style="color:red">确认将拍单置为业务核实？</div>';
        var html = '<div class="chenggong1">\n\
                        <span class="paidan"><h3>业务核实</h3>' + text + '</span>\n\
                        <div class="shenhei-btn"><input type="button" value="确定" class="determine" />\n\
                        <input type="button" value="取消" class="cancel" onclick="colse_hide()" />\n\
                        </div></div>';
        $(".yunBei").css("display", "block");
        $(document.body).append(html);
        $(".chenggong1").fadeIn();
        confirm(order_id);
    }
    function confirm(order_id) {
        $('.determine').click(function () {
            colse_hide();
            change_order_business_verify_status(order_id);
        });
    }
    //确定业务核实
    function change_order_business_verify_status(order_id) {
        var post_data = {order_id:order_id};
        $.post('/Finance/business_verify', post_data, function (res) {
            if (res.code == 200) {
                delay_alert('操作成功!');
                setTimeout(function () {
                    window.location.reload();
                }, 500);
            } else {
                delay_alert(res.msg);
            }
        }, 'json');
        return false;
    }




    /*业务核实*/
    /*function business_verify(order_id){
        var bg = $(".yunBei");
        var pp = $(".deparHover");
        var qd = $("#BVQueding");
        var qx = $("#BVQuxiao");

        bg.show();
        pp.show();
        $([bg,qd,qx]).each(function(i,n){
            $(n).unbind('click');
        });
        qx.click(hide_pp);
        bg.click(hide_pp);
        qd.click(function(){
            alert(order_id);
            $.post("/Finance/business_verify",{"order_id":order_id},function(data){
                if(data.code != 200){
                    shibai_alert(data.msg, 1500);
                    return false;
                }
                btn_alert("业务核实成功",1000,function(){
                    window.location.reload();
                });
            },"json");
        });
        function hide_pp(){
            bg.hide();
            pp.hide();
            bg.unbind('click');
        }
    }*/
</script>
</html>